let dragging = false,
  xPosition = "",
  yPosition = "",
  y = 0,
  xx = 0,
  yy = 0;

document.addEventListener(
  "mousedown",
  function (event) {
    dragging = true;
    xPosition = event.clientX;
    yPosition = event.clientY;
    xx = x;
    yy = y;
  },
  false
);

document.addEventListener(
  "mouseup",
  function (event) {
    dragging = false;
    xPosition = "";
    yPosition = "";
  },
  false
);

document.addEventListener(
  "mousemove",
  function (event) {
    if (dragging) {
      var xCurrent = event.clientX;
      var yCurrent = event.clientY;

      x = xCurrent - xPosition + xx;
      y = yCurrent - yPosition + yy;

      document.querySelector("#full_body").style.transform =
        "rotateX(" + -y + "deg) rotateY(" + x + "deg)";
    }
  },
  false
);
